package org.bao.action;

import javax.servlet.http.HttpServletRequest;

import org.bao.service.SmsService;
import org.bao.utils.MyUtils;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @ClassName: Sms
 * @Description: 发送短信
 * @author bql
 * @date 2019年4月27日
 *
 */
@Controller
public class Sms {

	@RequestMapping("/Sms")
	public ResponseEntity<String> sms(HttpServletRequest request) {
		// 获取电话号码
		String phone_no = request.getParameter("usertel");
		System.out.println("电话号码为：" + phone_no);
		
		//获取系统时间年月日
		String sysdate = MyUtils.sysDate();
		
		//获取验证码
		String stryan = MyUtils.authCode();
		
		//调用短信接口
		//SmsService.smsexecute(phone_no, stryan);
		
		return ResponseEntity.status(HttpStatus.OK).body(stryan);
	}

}
